package com.heima.common.exception;

import com.heima.model.common.enums.AppHttpCodeEnum;

/*
* TODO 自定义异常处理，主要处理可预见异常
*  */
public class CustomException extends RuntimeException{
    //todo 定义异常处理枚举
    private AppHttpCodeEnum appHttpCodeEnum;
    public CustomException(AppHttpCodeEnum appHttpCodeEnum) {
        this.appHttpCodeEnum = appHttpCodeEnum;
    }
    public CustomException(AppHttpCodeEnum appHttpCodeEnum,String msg) {
        appHttpCodeEnum.setErrorMessage(msg);
        this.appHttpCodeEnum = appHttpCodeEnum;
    }
    public AppHttpCodeEnum getAppHttpCodeEnum() {
        return appHttpCodeEnum;
    }
}
